https://leetcode.cn/problems/water-bottles-ii/submissions/518569266/

class Solution {
public:
    int maxBottlesDrunk(int numBottles, int numExchange) {

        int cnt = 0;
        cnt += numBottles;

        int k = numBottles, x = numExchange;

        while (k >= x)
        {
            cnt++;
            k -= x;

            k++, x++;

        }
        return cnt;

    }
};